package com.db.logger;

import java.util.Date;

public class Logger {
    private final String loggerName;
    private final Appender appender;

    public Logger(final String loggerName) {
        this.loggerName = loggerName;
        appender = AsyncFileAppender.getInstance();
    }

    public void log(final LogLevel level, final String message) {
        appender.append(new LogEvent(new Date(), level, Thread.currentThread()
                .getName(), loggerName, message));
    }

    public String getLoggerName() {
        return loggerName;
    }
}
